<?php
	//TuấnNK add (20080617_10h):
	//Các xử lý cho ajax:
	//echo basename($_SERVER['PHP_SELF']);

	require_once 'core/Debug.php'; //System Debug...
	require_once 'core/config.php';//System Config...
	require_once 'core/Init.php';  //System Init...
	require_once 'core/FaceLib.php';  //Cac ham facebook
	require_once 'core/PostLib.php';  //Cac ham post belive
	
	require_once 'includes/facebook.php';
	
	//Create our Application instance (replace this with your appId and secret).
	$facebook = new Facebook(array(
		'appId'     => FB_API_KEY,
		'secret'    => FB_SECRET,
		'cookie'    => true
	));
	
	//System process & output for ajax request

     $choice = array(
            "index"      	=>	"index"
    );
    
	$action = FunctionLib::getParam('act'); 

	if ($action == "" || $choice[$action]=="") {
		$choice[$action]="index";
	}

	require_once(ROOT_PATH."includes/ajax_action/".$choice[$action].".ajax.php");

    $run_me = new $choice[$action] ();
	$run_me->playme();
	        	
	//End process & ouput

	//Stop System
	System::halt();
?>